<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<html>
<head>
	<title>Demo管理</title>
	<meta name="decorator" content="default"/>
</head>
<body>
	<ul class="nav nav-tabs">
		<li class="active"><a href="${ctx}/demo/">Demo列表</a></li>
		<li><a href="${ctx}/demo/form">Demo添加</a></li>
	</ul>
	<form:form id="searchForm" modelAttribute="demo" action="${ctx}/demo/" method="post" class="breadcrumb form-search">
		<input id="pageNo" name="pageNo" type="hidden" value="${page.pageNo}"/>
		<input id="pageSize" name="pageSize" type="hidden" value="${page.pageSize}"/>
		<ul class="ul-form">
		<shiro:hasPermission name="demo:Demo:form">
			<li><label>名称：</label>
				<form:input path="name" htmlEscape="false" maxlength="64" class="input-medium"/>
			</li>
			<li><label>年龄：</label>
			<form:input path="age" htmlEscape="false" maxlength="64" class="input-medium"/>
			<!--  
				<select name="age">
					<option value="">全部</option>					
					<option value="1">默认状态</option>
					<option value="2">启用</option>
					<option value="3">禁用</option>	
				</select>
			-->
			</li>
			<li class="btns"><input id="btnSubmit" class="btn btn-primary" type="submit" value="查询"/></li>
			</shiro:hasPermission>
			<li class="clearfix"></li>
		</ul>
	</form:form>
	<sys:message content="${message}"/>
	<table id="contentTable" class="table table-striped table-bordered table-condensed">
		<thead>
			<tr>
				<th>名称</th>
				<th>生日</th>
				<th>身高</th>
				<th>创建时间</th>
				<th>年龄</th>
				<th>备注</th>
				<th>操作</th>
			</tr>
		</thead>
		<tbody>
		<c:forEach items="${page.list}" var="demo">
			<tr>
				<td><a href="${ctx}/demo/form?id=${demo.id}">
					${demo.name}
				</a></td>
				<td>
					<fmt:formatDate value="${demo.birthday}" pattern="yyyy-MM-dd"/>
				</td>
				<td>
					${demo.height}
				</td>
				<td>
					<fmt:formatDate value="${demo.createtime}" pattern="yyyy-MM-dd HH:mm:ss"/>
				</td>
				<td>
					${demo.age}
				</td>
				<td>
					${demo.remark}
				</td>
				<td>
					<shiro:hasPermission name="demo:Demo:update">
    				<a href="${ctx}/demo/form?id=${demo.id}">修改</a>
    				</shiro:hasPermission>
    				<shiro:hasPermission name="demo:Demo:delete">
					<a href="${ctx}/demo/delete?id=${demo.id}" onclick="return confirmx('确认要删除该Demo吗？', this.href)">删除</a>
					</shiro:hasPermission>
				</td>
			</tr>
		</c:forEach>
		</tbody>
	</table>
	<div class="pagination">${page}</div>
</body>
</html>